/**
 * Created by sicongdu on 17-11-21.
 */

var model = require("./model").team_message;

var release = (req, res) => {
  console.log(req.body)
  var document = new model({
    role: req.body.role,
    id: req.body.id,
    title: req.body.title,
    starttime: req.body.starttime,
    endtime: req.body.endtime,
    contactWay: req.body.contactWay,
    contactValue: req.body.contactValue,
    content: req.body.content,
    rcontent: req.body.rcontent
  });

  document.save((err, resin) => {
    if (err) {
      res.send("save error")
    } else {
      var ret = {
        error: 1
      }
      res.send(JSON.stringify(ret));
    }
  })
};

module.exports = {
  release: release
};
